<%@page import="servlets.MainServlet"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<link href="../css/verEnvio.css" rel="stylesheet" type="text/css">
<link href="../css/form.css" rel="stylesheet" type="text/css">
<jsp:include page="header.jsp" flush="true" />
<div id="content">
	<div class="bootstrap-frm">
		<h1>Envío Intersucursal</h1>
		<label> 
			<span class="label">Cliente:</span>
			<span class="valor"><c:out value="${envio.idCliente}"/></span>
		</label>
		
		<label> 
			<span class="label">En viaje:</span>
			<span class="valor">
				<c:choose> 
					<c:when test="${envio.enViaje}">
						<span style="color: green; font-weight: bold;">Sí</span>
					</c:when>
					<c:otherwise>
						<span style="color: red; font-weight: bold;">No</span>
					</c:otherwise>
				</c:choose>
			</span>
		</label>
	
		<label> <span class="label">Sucursal Origen:</span> 
			<span class="valor"><c:out value="${envio.nombreSucursalOrigen}"/></span>
		</label>
	
	           			<label> <span class="label">Sucursal Destino:</span>
			<span class="valor"><c:out value="${envio.nombreSucursalDestino}"/></span>
		</label>
		
		<label> 
			<span class="label">Fecha Recepcion:</span>
			<span class="valor"><c:out value="${envio.fechaRecepcion}"/></span>
		</label>
		
		<c:if test="${envio.entregado}">
			<label> 
				<span class="label">Fecha Entrega Real:</span>
				<span class="valor"><c:out value="${envio.fechaEntregaReal}"/></span>
			</label>
		</c:if>
		
		<h2>Destinatario</h2>
		<label>
			<span class="label">Nombre</span>
			<span class="valor"><c:out value="${envio.nombreDestinatario}"/></span>
		</label>
		<label>
			<span class="label">Apellido</span>
			<span class="valor"><c:out value="${envio.apellidoDestinatario}"/></span>
		</label>
		<label>
			<span class="label">DNI</span>
			<span class="valor"><c:out value="${envio.dniDestinatario}"/></span>
		</label>
		<h2>Carga</h2>
		<label>
			<span class="label">Ancho</span>
			<span class="valor"><c:out value="${envio.anchoCM}"/></span>
		</label>
		<label>
			<span class="label">Alto</span>
			<span class="valor"><c:out value="${envio.altoCM}"/></span>
		</label>
		<label>
			<span class="label">Profundidad</span>
			<span class="valor"><c:out value="${envio.profundidadCM}"/></span>
		</label>
		<label>
			<span class="label">Peso</span>
			<span class="valor"><c:out value="${envio.pesoKG}"/></span>
		</label>
		<label>
			<span class="label">Volumen</span>
			<span class="valor"><c:out value="${envio.volumenM3}"/></span>
		</label>
		<label>
			<span class="label">Refrigerado</span>
			<span class="valor"><c:out value="${envio.refrigeradoValor}"/></span>
		</label>
		<label>
			<span class="label">Fragilidad</span>
			<span class="valor"><c:out value="${envio.fragilidadValor}"/></span>
		</label>
		<label>
			<span class="label">Peligrosidad</span>
			<span class="valor"><c:out value="${envio.peligrosidadValor}"/></span>
		</label>
		<label>
			<span class="label">Apilable</span>
			<span class="valor"><c:out value="${envio.apilable}"/></span>
		</label>
		<label>
			<span class="label">Especiales</span>
			<span class="valor"><c:out value="${envio.especiales}"/></span>
		</label>
		<c:if test="${envio.manifiesto != 'files' && envio.manifiesto != null}">
			<label>
				<span class="label">Manifiesto</span>
				<span class="imagen">
					<a href="../files/<c:out value="${envio.manifiesto}"/>" target="_blank" style="border: none;">
						<img src="../files/<c:out value="${envio.manifiesto}"/>" style="width: 360px;"/>
					</a>
				</span>
			</label>
		</c:if>
		
	</div>
	
	<c:if test="${envio.enDestino && !envio.entregado}">
		<br/>
		<form action="../servlet/mainServlet?actionId=16" method="post" class="frm">
			<h1>Entregar Envío
			</h1>
			<input type="hidden" name="envioId" value="<c:out value="${envio.envioId}"/>"/>
			<label>
				<span>&nbsp;</span>
				<input type="submit" class="button" value="Entregar"/>
			</label>
		</form>
	</c:if>
</div>
<jsp:include page="footer.jsp" flush="true" />